/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #2c3e50;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.5s ease-out;
}

/* 标题样式 */
h1 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.2em;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 3px;
}

/* 问题列表样式 */
.question-list {
    list-style: none;
    padding: 0;
}

.question-list li {
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.question-list li:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.question-list a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    display: block;
    font-size: 1.1em;
}

.question-list a:hover {
    color: #3498db;
}

/* 投票表单样式 */
.vote-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.choice-option {
    margin-bottom: 15px;
}

.choice-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-label:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.choice-input:checked + .choice-label {
    background: #e3f2fd;
    border-color: #3498db;
}

.choice-text {
    font-size: 1.1em;
    color: #2c3e50;
}

.choice-votes {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: 500;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 25px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1em;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #2980b9, #3498db);
}

/* 结果页面样式 */
.results-list {
    list-style: none;
    padding: 0;
}

.results-list li {
    margin: 15px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.results-list li:hover {
    transform: translateX(5px);
    background: #fff;
}

.vote-count {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 错误消息样式 */
.error-message {
    color: #e74c3c;
    padding: 15px;
    margin: 15px 0;
    background: #fde8e8;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 20px;
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .btn {
        width: 100%;
        margin: 10px 0;
    }
    
    .results-list li {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(52, 152, 219, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(46, 204, 113, 0.1) 0%, transparent 50%);
    z-index: -1;
}

/* 问题元数据样式 */
.question-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.publish-date, .total-votes {
    color: #666;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.publish-date i, .total-votes i {
    color: #3498db;
}

.total-votes {
    background: rgba(52, 152, 219, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.total-votes i {
    color: #2ecc71;
}

/* 页面头部样式 */
.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    margin-bottom: 10px;
}

.page-header h1 i {
    color: #3498db;
    margin-right: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
    margin: 0;
}

/* 统计卡片样式 */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 2em;
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
    padding: 15px;
    border-radius: 12px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
}

/* 搜索框和管理后台容器 */
.search-filter-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

/* 搜索框样式 */
.search-box {
    position: relative;
    flex: 1;
    max-width: 600px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

.search-box input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

/* 管理后台链接样式 */
.admin-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.admin-link i {
    font-size: 1.1em;
}

.admin-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #34495e, #2c3e50);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .search-filter-container {
        flex-direction: column;
        gap: 15px;
    }

    .search-box {
        max-width: 100%;
    }

    .admin-link {
        width: 100%;
        justify-content: center;
    }
}

/* 筛选按钮样式 */
.question-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: #f8f9fa;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #e9ecef;
}

.filter-btn.active {
    background: #3498db;
    color: white;
}

/* 问题卡片样式 */
.question-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.question-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.question-title {
    font-size: 1.2em;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    flex: 1;
}

.question-status {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    color: #666;
}

.status-new {
    background: #2ecc71;
    color: white;
}

.meta-left {
    display: flex;
    gap: 15px;
    align-items: center;
}

.meta-right {
    display: flex;
    align-items: center;
}

.btn-vote {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-vote:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state i {
    color: #95a5a6;
    margin-bottom: 15px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
    }

    .question-header {
        flex-direction: column;
        gap: 10px;
    }

    .question-meta {
        flex-direction: column;
        gap: 15px;
    }

    .meta-left {
        flex-direction: column;
        align-items: flex-start;
    }

    .meta-right {
        width: 100%;
    }

    .btn-vote {
        width: 100%;
        justify-content: center;
    }
}

/* 投票详情页样式 */
.vote-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.vote-form-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    height: 600px; /* 调整为 600px */
}

.chart-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    height: 600px;  /* 调整为 600px */
    position: relative;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-container h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-align: center;
}

.choice-input {
    display: none;
}

.choice-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.choice-label:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.choice-input:checked + .choice-label {
    background: #e3f2fd;
    border-color: #3498db;
}

.choice-text {
    font-size: 1.1em;
    color: #2c3e50;
}

.choice-votes {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: 500;
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn-primary:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    text-decoration: none;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #3498db;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .vote-container {
        grid-template-columns: 1fr;
    }
    
    .vote-form-container {
        height: auto; /* 移动端高度自适应内容 */
    }

    .chart-container {
        height: 400px;  /* 移动端高度 */
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .choice-label {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .choice-votes {
        width: 100%;
        text-align: center;
    }
}

.vote-tips {
    margin-top: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.vote-tips h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vote-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.vote-tips li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.vote-tips li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: #3498db;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 投票状态消息 */
.voted-message {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-out;
}

.voted-message i {
    font-size: 4em;
    color: #2ecc71;
    margin-bottom: 20px;
    animation: scaleIn 0.5s ease-out;
}

.voted-message h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.voted-message p {
    color: #666;
    font-size: 1.1em;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 消息提示样式 */
.messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.message {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s ease;
}

.message.success {
    background: #2ecc71;
    color: white;
}

.message.error {
    background: #e74c3c;
    color: white;
}

.message.info {
    background: #3498db;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 进度条样式 */
.progress-container {
    margin-top: 20px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    color: #666;
    font-size: 0.9em;
}

/* 消息动画 */
.message {
    transition: opacity 0.3s ease;
}

.vote-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.vote-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.vote-actions .btn i {
    font-size: 1.1em;
}

.btn-manage {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background-color: #34495e;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    margin-left: 10px;
    transition: background-color 0.3s;
}

.btn-manage:hover {
    background-color: #2c3e50;
    color: white;
    text-decoration: none;
}

.btn-manage i {
    margin-right: 5px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.admin-link:hover {
    background-color: #2980b9;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.admin-link.logout {
    display: none;
}

.admin-link i {
    margin-right: 5px;
}

.search-filter-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

/* 头部样式 */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 1.5rem;
    color: #3498db;
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
    color: #2c3e50;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: #7f8c8d;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #3498db;
    background-color: #f7f9fc;
}

.nav-link.active {
    color: #3498db;
    background-color: #f7f9fc;
}

.nav-link i {
    margin-right: 0.5rem;
}

/* 底部样式 */
.main-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: #3498db;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section p {
    line-height: 1.6;
    color: #bdc3c7;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #3498db;
}

.footer-section ul li i {
    margin-right: 0.5rem;
    color: #3498db;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #34495e;
}

.footer-bottom p {
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav {
        width: 100%;
        justify-content: center;
    }

    .admin-actions {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-section ul li i {
        margin-right: 0.5rem;
    }
} 